package com.baor.dao;

import com.baor.domain.AdminVo;
import com.github.yulichang.base.mapper.MPJJoinMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface AdminDao extends MPJJoinMapper<AdminVo> {
    @Select("select DISTINCT a.admin_id,a.admin_account,a.last_time,role_id,a.admin_ip,a.admin_image,\n" +
            "        (select role_name from t_role where role_id = a.role_id) as role_name,\n" +
            "        CASE WHEN a.admin_status = 0 THEN '正常'\n" +
            "        When a.admin_status = 1 Then '锁定' END AS admin_status ,a.admin_name,\n" +
            "\t\t\t\t(select site_name from t_site where site_id = b.site_id) as site_name,b.site_id\n" +
            "\t\t\t\t from t_admin a  join t_site_admin b on a.admin_id  = b.admin_id  where admin_account =#{adminAccount} and admin_password =#{adminPassword}")
    List<AdminVo> selectUserByUserNameAndSite(AdminVo vo);
    @Select("select * from t_admin where admin_account = #{adminAccount} and admin_password =#{adminPassword}")
    List<AdminVo> selectUserByUserName(AdminVo vo);
    List<AdminVo> list(Map<String,Object> params);
    Map<String,Object> findPageCount(Map<String,Object> params);
    int shopAdmin(int adminId);
    int updateTime(Map<String,Object> params);
    int insertCenter(AdminVo adminVo);
    int findAdminId();
}
